/*
 * @Author: wangwei wwdqq7@qq.com
 * @Date: 2025-04-01 15:30:00
 * @LastEditors: wangwei wwdqq7@qq.com
 * @LastEditTime: 2025-04-01 15:30:00
 * @FilePath: /FullStack/pro/typeorm-mysql/src/dto/permission.dto.ts
 * @Description: 权限DTO，定义权限相关请求和响应的数据结构
 */
import { ApiProperty } from '@nestjs/swagger';

export class CreatePermissionDto {
  @ApiProperty({
    description: '权限操作类型',
    example: 'SELECT',
    required: true,
  })
  action: string;

  @ApiProperty({
    description: '权限描述',
    example: '查询数据权限',
    required: false,
  })
  description?: string;
}

export class UpdatePermissionDto {
  @ApiProperty({
    description: '权限操作类型',
    example: 'SELECT',
    required: false,
  })
  action?: string;

  @ApiProperty({
    description: '权限描述',
    example: '查询数据权限',
    required: false,
  })
  description?: string;
}

export class PermissionResponseDto {
  @ApiProperty({
    description: '权限ID',
    example: 1,
  })
  id: number;

  @ApiProperty({
    description: '权限操作类型',
    example: 'SELECT',
  })
  action: string;

  @ApiProperty({
    description: '权限描述',
    example: '查询数据权限',
  })
  description: string;

  @ApiProperty({
    description: '创建时间',
    example: '2025-04-01T15:30:00.000Z',
  })
  createdAt: Date;

  @ApiProperty({
    description: '更新时间',
    example: '2025-04-01T15:30:00.000Z',
  })
  updatedAt: Date;
}
